//
//  TeachBottomCell.m
//  Coach_HaiGeEr
//
//  Created by liuchen on 2018/10/15.
//  Copyright © 2018年 海格尔. All rights reserved.
//

#import "TeachBottomCell.h"
@interface TeachBottomCell()
@property (nonatomic,weak) UILabel *trainTimeLabel;
@property (nonatomic,weak) UILabel *trainerNumLabel;
@end

@implementation TeachBottomCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    return self;
}

#pragma mark ==========创建视图==========
- (void)createSubView{
    UILabel *trainTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(35*SCALEUNIT, 0, 350*SCALEUNIT, self.frame.size.height)];
    trainTimeLabel.textAlignment = NSTextAlignmentCenter;
    trainTimeLabel.textColor = [UIColor colorWithHexString:@"#686868"];
    trainTimeLabel.font = [UIFont systemFontOfSize:LoginFont-3];
    _trainTimeLabel = trainTimeLabel;
    [self.contentView addSubview:self.trainTimeLabel];
    
    UILabel *trainerNumLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(trainTimeLabel.frame), 0, 170*SCALEUNIT, self.frame.size.height)];
    trainerNumLabel.textAlignment = NSTextAlignmentCenter;
    trainerNumLabel.textColor = [UIColor colorWithHexString:@"#21d4a4"];
    trainerNumLabel.font = [UIFont systemFontOfSize:LoginFont-3];
    _trainerNumLabel = trainerNumLabel;
    [self.contentView addSubview:self.trainerNumLabel];
}

#pragma mark ==========获取数据==========
- (void)setDic:(NSDictionary *)dic{
    _dic = dic;
    self.trainTimeLabel.text = [_dic objectForKey:@"name"];
    self.trainerNumLabel.text = [NSString stringWithFormat:@"%ld",[[_dic objectForKey:@"cancelCount"] integerValue]];
}





- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
